package com.neusoft.service.impl;

import com.neusoft.dao.PayMoneyDao;
import com.neusoft.entity.PayMoney;
import com.neusoft.service.PayMoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PayMoneyServiceImpl implements PayMoneyService {
    @Autowired
    private PayMoneyDao payMoneyDao;

    @Override
    public PayMoney queryByPayId(Integer payid) {
        return payMoneyDao.queryByPayId(payid);
    }

    @Override
    public PayMoney insert(PayMoney payMoney) {
        payMoneyDao.insert(payMoney);
        return payMoney;
    }

    @Override
    public boolean deleteById1(Integer payid) {
        if(payid == null){
            return false;
        }
        StringBuffer sb = new StringBuffer("payid =");
        sb.append(payid);
        System.out.println(sb.toString());
        return this.payMoneyDao.delete1("stu.paymoney",sb.toString())>0;
    }
}
